<template>
   <div class="person">
    <h2>姓名：{{name}}</h2>
    <h2>年龄：{{age}}</h2>
    <button @click="showTel">查看联系方式</button>
    <button @click="changename">修改名字</button>
    <button @click="addAge">改变年龄</button>
   </div>
</template>

<script lang="ts"> 
//     export default {
//         name:"Person234",
    
//     }
</script>
<script lang="ts" setup name="Person123">
            let  name="张三";
            let  age=18;
            let  tel="1888888888888";
            // alert(this)
           function changename(){
                name = "李三"        
            }
           function addAge(){
                age +=1
            }
           function showTel(){
            // alert(this)
            // alert(JSON.stringify(this))
                // alert(this.tel)
                alert(tel)
            }
</script>

<style  scoped>


    .person{
        background-color: skyblue;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 0 10px;
    }
</style>